--[[ 编码: WMS-16-13 名称: 盘点计划-错误状态重置 日期:2025-1-29 作者:HAN 入口函数: ResetState 功能说明: 把错误状态设置为执行状态 更改记录: --]] wms_op = require( "wms_operation" ) function ResetState ( strLuaDEID ) local nRet, strRetInfo local objs -- step1 获取当前点中的任务 nRet, objs = m3.GetSysDataJson( strLuaDEID ) if ( nRet ~=0 ) then lua.Error( strLuaDEID, debug.getinfo(1), objs ) end -- [{"id":"","attrs":[{"attr":"","value":""},..]},..] local nCount = #objs if (nCount == 0) then return end local id = lua.trim_guid_str( objs[1].id ) local strUpdateSql = "N_B_STATE = 0, S_ERR = ''" local strCondition = "S_ID = '"..id.."'" nRet, strRetInfo = mobox.updateDataAttrByCondition( strLuaDEID, "Count_Plan", strCondition, strUpdateSql ) if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "更新【盘点计划】信息失败!"..strRetInfo ) end local action = { { action_type = "refresh_cur_row", value = "" } } nRet, strRetInfo = mobox.setAction(strLuaDEID, lua.table2str(action)) if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction错误: "..strRetInfo) end end